# -*- coding:utf-8 -*-
"""
Created on 30.04.2010

@author: Пользователь
"""

from berlin.data.models import *
from berlin.data.views import person_view
from django.contrib import admin
from django import forms
from django.utils.safestring import mark_safe
from django.conf.urls.defaults import patterns

#===============================================================================
# class PersonAdminForm(forms.ModelForm):
#    # ModelForm
#    class Meta:
#        model = Person
#    # and custom fields
#    def __init__(self, *args, **kwargs):
#        super(PersonAdminForm.self).__init__(*args, **kwargs)
#===============================================================================
        
    
#===============================================================================
# class PersonAdmin(admin.ModelAdmin):
#    # form = PersonAdminForm
#    def render_change_form(self, request, context, **kwargs):
#        form = context['adminform'].form
#        
#        fieldsets = [(None, {'fields' : form.fields.keys()})]
#        adminform = admin.helpers.AdminForm(form, fieldsets, self.prepopulated_fields)
#        media = mark_safe(self.media + adminform.media)
#        
#        context.update(adminform=adminform, media=media)
#        
#        return super(PersonAdmin, self).render_change_form(request, context, **kwargs)
#===============================================================================

#===============================================================================
# class PersonAdmin(admin.ModelAdmin):
#    def get_urls(self):
#        urls = super(PersonAdmin, self).get_urls()
#        my_urls = patterns('',
#            (r'^my_view/$', self.admin_site.admin_view(person_view)), 
#        )
#        return my_urls + urls
#===============================================================================

admin.site.register(Person)
admin.site.register(PersonParameter)
admin.site.register(Group)
# admin.site.register(GroupParameter)
admin.site.register(Event)
# admin.site.register(EventParameter)
